package com.wk.code.wkserver.constant.enums;


/**
 * @author wq
 * @version 1.0
 * @date 2020/4/29 17:12
 * 账号类型
 */
public enum AccountTypeEnum {
    /**
     * 接单收益
     */
    CUSTOMER_MONEY(1, "接单收益"),
    /**
     * 提现中
     */
    WITHDRAW(2, "提现中"),
    /**
     * 提现失败
     */
    WITHDRAW_FAIL(3, "提现失败"),
    /**
     * 提现完成
     */
    WITHDRAW_SUCCESS(4, "提现完成");


    public final Integer code;
    public final String value;

    AccountTypeEnum(Integer code, String value) {
        this.code = code;
        this.value = value;
    }


    public Integer getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }

    public static String getValue(Integer code) {
        AccountTypeEnum[] typeEnums = AccountTypeEnum.values();
        for (AccountTypeEnum typeEnum : typeEnums) {
            if (code.equals(typeEnum.getCode())) {
                return typeEnum.getValue();
            }
        }
        return null;
    }


}
